var albumService = require("../service/albumService");

/**
 * 加载专辑页面有关的视图路由
 * @param app - express对象
 */
const addAlbumRoute = function(app){
	//专辑列表
	app.get(["/", "/index"], function (request, response) {
		//在主页显示专辑列表
		var query = request.query;
		albumService.dir(query, response, "index");
	});

	//专辑内容
	app.get("/album/:id", function(request, response) {
		var albumId = request.params.id;
		albumService.get(albumId, response, "music");
	})
};
module.exports = addAlbumRoute;